<template>
  <div class="test">
    <h1>{{ ctime }}</h1>
    <h1>{{ ctime | dateFmt }}</h1>
    <h1>{{ ctime | dateFmt('YYYY/MM/DD') }}</h1>
    <h1>{{ ctime | dateFmt('hh:mm:ss') }}</h1>
  </div>
</template>
<script>
import moment from 'moment'
export default {
  data() {
    return {
      ctime: Date.now()
    }
  },
  filters: {
    dateFmt(ctime, str = 'YYYY-MM-DD hh:mm:ss') {
      return moment(ctime).format(str)
    }
  }
}
</script>
<style lang="scss"></style>
